package cn.itsource.service.impl;

import cn.itsource.api.LoginFeignClient;
import cn.itsource.pojo.domain.Login;
import cn.itsource.result.JSONResult;
import cn.itsource.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginFeignClientImpl implements LoginFeignClient {

    @Autowired
    private ILoginService loginService;

    @Override
//    @GlobalTransactional
    public JSONResult create(Login login) {
        System.err.println(login);
        boolean save = loginService.save(login);
        if (save){
            return JSONResult.success();
        }
        return JSONResult.error();
    }
}
